package org.flexthinker.module.impl
{
    import org.flexthinker.module.Descriptor;

    [DefaultProperty("dependencies")]

    /**
     * Descriptor for a single module.
     * Provide this descriptor to the <code>ModuleViewLoader</code> class in order to load it into UI.
     * To preload the module, use <code>ModuleDescriptorLoader</code>.
     *
     * @see org.flexthinker.module.ModuleViewLoader
     * @see com.adobe.cairngorm.module.impl.ModuleDescriptorLoader
     */
    public class ModuleDescriptor extends DescriptorImpl
    {
        public var dependencies:Vector.<Descriptor>;

        public function ModuleDescriptor(url:String = null)
        {
            super(url);
            resetDependencies();
        }

        public function addDependency(descr:Descriptor):void
        {
            dependencies.push(descr);
        }

        private function resetDependencies():void
        {
            dependencies = new Vector.<Descriptor>();
        }

    }
}